import { onBeforeRouteLeave } from 'vue-router'

export default function (routeName) {
	onBeforeRouteLeave((to, from, next) => {
		if (to.name === routeName) to.meta.keepAlive = true
		next()
	})
}
